//
//  ZHFenLeiTableViewController.m
//  ZhanHui
//
//  Created by 彭超 on 16/5/13.
//  Copyright © 2016年 彭超. All rights reserved.
//

#import "ZHFenLeiTableViewController.h"

@interface ZHFenLeiTableViewController ()

@property (nonatomic,strong) NSMutableArray*fenleidataSource;

@end

@implementation ZHFenLeiTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createData];
}

- (void)initDataSource
{
    if (_fenleidataSource==nil) {
        _fenleidataSource=[[NSMutableArray alloc]init];
    }
}

-(void)createData
{
    [self initDataSource];
    self.title=@"分类";
    NSArray*fenlei=[NSArray arrayWithObjects:@"书画展",@"收藏品展",@"雕塑展",@"民间艺术展",@"话剧",@"歌剧",@"交响乐",@"音乐会",nil];
  for (int i=0; i<fenlei.count; i++) {
        [_fenleidataSource addObject:fenlei[i]];

    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _fenleidataSource.count;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fenleicell"];
    if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"fenleicell"];
 }
    cell.textLabel.text=_fenleidataSource[indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.imageView.image=[UIImage imageNamed:@"search"];
//    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

@end
